package com.party.core.model.photo;

import org.springframework.beans.BeanUtils;

public class PhotoProjectOutput extends PhotoProject {
    private static final long serialVersionUID = -2526762541367852175L;

    private String circleName;
    private String qrcodeUrl;
    private String memberName;

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public String getCircleName() {
        return circleName;
    }

    public void setCircleName(String circleName) {
        this.circleName = circleName;
    }

    public static PhotoProjectOutput transform(PhotoProject photoProject) {
        PhotoProjectOutput output = new PhotoProjectOutput();
        BeanUtils.copyProperties(photoProject, output);
        return output;
    }

    @Override
    public String toString() {
        return "PhotoProjectOutput{" +
                "circleName='" + circleName + '\'' +
                ", qrcodeUrl='" + qrcodeUrl + '\'' +
                ", memberName='" + memberName + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof PhotoProjectOutput)) return false;
        if (!super.equals(o)) return false;

        PhotoProjectOutput output = (PhotoProjectOutput) o;

        if (circleName != null ? !circleName.equals(output.circleName) : output.circleName != null) return false;
        if (qrcodeUrl != null ? !qrcodeUrl.equals(output.qrcodeUrl) : output.qrcodeUrl != null) return false;
        return memberName != null ? memberName.equals(output.memberName) : output.memberName == null;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (circleName != null ? circleName.hashCode() : 0);
        result = 31 * result + (qrcodeUrl != null ? qrcodeUrl.hashCode() : 0);
        result = 31 * result + (memberName != null ? memberName.hashCode() : 0);
        return result;
    }

    public String getQrcodeUrl() {
        return qrcodeUrl;
    }

    public void setQrcodeUrl(String qrcodeUrl) {
        this.qrcodeUrl = qrcodeUrl;
    }
}
